<html>
	<head>	
		<title>管理院系</title>
		<load href= "__JS__/jshelper.js" /> 
		<load href="__CSS__/menu.css" />
		<script type="text/JavaScript">
			function collegeedit(id){
				window.location.href="__URL__/collegeedit/id/"+id;
			}
			function collegedelete(id){
				if (confirm("你确定要删除吗")==true) {
					//posthelper([["id",id],],'__URL__/collegedelete');
					postwith('__URL__/collegedelete',{id:id});
				}
			}
			function show(){
									var tab=document.getElementById("tab");
									var tr=tab.getElementsByTagName("tr");
								for(var i=0;i<=tr.length;i++){
								if(i%2==0){
									tr[i].style.backgroundColor="#fff";
								}else{
									tr[i].style.backgroundColor="#f0f0f0";	
									}
								}
							}
					window.onload=show;
		</script>
		<load href="__JS__/jQuery/jquery.js" />
       	<load href="__JS__/jQuery/jquery.form.js" />
		<script type="text/JavaScript">
        $(function(){
            $('#form1').ajaxForm({
                //beforeSubmit:  function(){alert("before");},  // pre-submit callback
                success:       complete,  // post-submit callback
                error:function(){alert("error");},
                dataType: 'json'
            });
            
            function complete(data){
                if (data.status==1)
                {
                	window.location=window.location.href;
                }else{
                    $('#result').html(data.info).show();
                }
            }
        });
        </script>
	</head>
	<body bgcolor="#EEEEEE">	
		<layout name="Auth:header" />
		<iframe src="__URL__/menu" style="position:absolute; left:40px; top:350px; width:180px; height:190px;" frameborder=”no” border=”0″ marginwidth=”0″ marginheight=”0″ scrolling=”no”></iframe>
		<div  style="position:relative; top:-70px; left:240px; font-size:12px; width:60%;">
		当前位置：
		<a href='__APP__/index/index'>主页</a>>
		<a href='__URL__/index'>后台管理</a>>
		院系管理
		</div>
		<div id='result' style="position:relative; left:210px;"></div>	
		<div style=" width:290px;position:relative; left:210px;">
		  <form id="form1" method="post" action="__URL__/collegeadd" >
				院系名称<input type="text" name="name" style="width:100px; font-size:16px">
				<input type="submit" value="添加院系">
		  </form>
  	</div>
			<!--显示学院-->
			<div id="College_Show"  style="width:68%; position:relative; left:210px;">
				<table width="100%" border="0" align="center" cellpadding="0px" cellspacing="0px">
					<thead  style="background-color:f0f0f0;">
						<tr id="table_college_show_title">
							<td style="width:150px">院系名称</td>
							<td style="width:50px">操作</td>
						</tr>
					</thead>
					<load href"__PUBLIC__/js/list_show.js">
					<tbody id="tab">
						<volist name='list' id='vo' >
							<tr id="table_college_show">
								
								<td style="width:180px;">{$vo.name}</td><!--院系名称-->
								<td style="display:none;">{$vo.id}</td>	<!--院系ID-->
								<td style="width:100px">
									<input type="button" name="collegeedit"onClick="collegeedit({$vo.id})" value="编辑">
									<input name="delete_college" type="reset" onClick="collegedelete({$vo.id})" value="删除">
								</td>
							</tr>
						</volist>
					</tbody>		
				</table>
			
				<div align="right" class="green-black" style="width:900px; position:relative; top:20px; left:-35px;">
					{$page}
				</div>
	</div>
	</body>
</html>